#include "mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    /* 设置宽高为 800*480，位置在0,0 */
    this->setGeometry(0,0,800,480);

    pushButton_1 = new QPushButton("窗口皮肤 1", this);
    pushButton_2 = new QPushButton("窗口皮肤 2", this);

    /* 设置两个 QPushBotton 的位置*/
    pushButton_1->setGeometry(300, 200, 80,40);
    pushButton_2->setGeometry(400, 200, 80,40);

    /* 信号槽连接 */
    connect(pushButton_1, SIGNAL(clicked()), this, SLOT(pushButton_1_Clicked()));
    connect(pushButton_2, SIGNAL(clicked()), this, SLOT(pushButton_2_Clicked()));
}

MainWindow::~MainWindow()
{
}

/* 槽函数的实现 */
void MainWindow::pushButton_1_Clicked()
{
    this->setStyleSheet("QMainWindow { background-color:rgba(255,245,238,100%);}");
}
void MainWindow::pushButton_2_Clicked()
{
    this->setStyleSheet("QMainWindow { background-color:rgba(238,122,233,100%);}");
}
